{extend name="base" /}
{block name="content"}
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="{:url('index/welcome')}"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>商城</span>
            <span class="icon-angle-right"></span>
            <span>商品管理</span>
            <span class="icon-angle-right"></span>
            <span>商品管理</span>
            <span class="icon-angle-right"></span>
            <span>商品列表</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <form class="layui-form m-list-form">
                <table class="m-table">
                    <tbody class="datas">
                        <tr>
                            <th width="5%">排序</th>
                            <th width="5%">ID</th>
                            <th width="8%">所在分类</th>
                            <th width="26%">商品名称</th>
                            <th width="8%">价格</th>
                            <th width="8%">总库存</th>
                            <th width="10%">销量（自定义/实际）</th>
                            <th width="10%">状态</th>
                            <th width="10%">录入时间</th>
                            <th width="10%">操作</th>
                        </tr>
                        {foreach name="data" item="v"}
                        <tr>
                            <td><input type="text" name="list_order[{$v.id}]" lay-skin="primary" class="u-ipt u-ipt-tiny" value="{$v.list_order}" /></td>
                            <td>{$v.id}</td>
                            <td>{$v.category_name}</td>
                            <td>{$v.goods_name}</td>
                            <td>成本价：{$v.cost_price}<br/>市场价：{$v.market_price}<br/>销售价：{$v.sale_price}</td>
                            <td><em{if condition="$v['goods_stock'] elt $v['goods_stock_alarm']"} style="font-weight: bold; color: #d60000;"{/if}>{$v.goods_stock}</em></td>
                            <td>{$v.diy_sale_nums}/{$v.actual_sale_nums}</td>
                            <td class="m-goods-status">
                                <p class="clearfix"><span class="u-status{$v.is_sale ? ' u-status-primary' : ' u-status-danger'}" data-id="{$v.id}" data-key="is_sale" data-value="{$v.is_sale}">{$v.is_sale_txt}</span>
                                <span class="u-status{$v.is_latest ? ' u-status-primary' : ' u-status-danger'}" data-id="{$v.id}" data-key="is_latest" data-value="{$v.is_latest}">{$v.is_latest_txt}</span></p>
                                <p class="clearfix"><span class="u-status{$v.is_hot_sale ? ' u-status-primary' : ' u-status-danger'}" data-id="{$v.id}" data-key="is_hot_sale" data-value="{$v.is_hot_sale}">{$v.is_hot_sale_txt}</span>
                                <span class="u-status{$v.is_recommand ? ' u-status-primary' : ' u-status-danger'}" data-id="{$v.id}" data-key="is_recommand" data-value="{$v.is_recommand}">{$v.is_recommand_txt}</span></p>
                            </td>
                            <td>{$v.create_time}</td>
                            <td class="m-opt"><a href="{:url('add', ['id' => $v.id])}" title="编辑"><i class="icon-pencil"></i></a><a href="javascript:;" title="删除" class="u-del" data-id="{$v.id}"><i class="icon-trash"></i></a></td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </form>
            {include file="public:page" /}
        </div>
    </div>
</div>
{/block}
{block name="extrajs"}
{include file="laypage" /}
{/block}